import type React from "react"
import type { Metadata } from "next"
import { Inter } from "next/font/google"
import { AuthProvider } from "@/contexts/auth-context"
import { ToastProvider } from "@/components/ui/toast"
import { ConfirmProvider } from "@/components/ui/confirm"
import { PromptProvider } from "@/components/ui/prompt"
import ErrorBoundary from "@/components/error-boundary"
import "./globals.css"

const inter = Inter({ subsets: ["latin"] })

export const metadata: Metadata = {
  title: "创业者之家后台管理端",
  description: "为创业者提供全方位的后台管理服务",
}

export default function RootLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    <html lang="zh-CN">
      <body className={inter.className}>
        <ErrorBoundary>
          <ToastProvider>
            <ConfirmProvider>
              <PromptProvider>
                <AuthProvider>
                  {children}
                </AuthProvider>
              </PromptProvider>
            </ConfirmProvider>
          </ToastProvider>
        </ErrorBoundary>
      </body>
    </html>
  )
}